//导入封装好的axios
import request from './request'
import qs from 'qs'
//定义一个请求精品的数据
export const JingPinAPI = () => request.get("/products/recommend")
//热门兑换
export const HotAPI = () => request.get("/products/hot")

//定义一个发送验证码的请求
export const SendSMSAPI = (params) => request.post("/sendSMS",
   qs.stringify(params))

//登录
export const PhoneReginAPI = (params) => request.post("/phoneRegin",
   qs.stringify(params))
//微信登陆
export const WeiXinLoginAPI = (params) => request.post("/wechatUsers/PCLogin",
   qs.stringify(params))
//微信绑定
export const bangdingAPI = (params) => request.post("/wechatUsers/binding",
   qs.stringify(params))
//获取用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles")

//商品详情
export const GoodDetailsAPI = (params) => request.get(`/products/${params}`)
//加入购物车
export const addgAPI = (params) => request.post("/shop/carts/add",
   qs.stringify(params))
//全部商品
export const GoodsSearchApi = (params) => request.get("/products", { params })
//获取购物车/shop/carts
export const CartDataApi = () => request.get("/shop/carts")
//删除商品/shop/carts?productIds={id}
export const ProductIdsAPI = (id) => request.delete(`/shop/carts?productIds=${id}`)